]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-global: Handle empty variants better
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 14 Oct 2013 04:00:24 +0000 (00:00 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 21 Oct 2013 18:13:21 +0000 (14:13 -0400)
In cases where we have an array of 0 elements or similar, the
data returned may be NULL. Since g_file_replace_contents will
assert in this case, simply check for this and delete the file
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=710137

src/shell-global.c

index e711dff09a9cccb5e533f598b37ae1f3e6050f10..99aad50b82f2bc8a5b0d927964aa7a4e95635c3e 100644 (file)
@@ -1770,7 +1770,7 @@ shell_global_set_runtime_state (ShellGlobal  *global,
 
   path = get_runtime_state_path (global, property_name);
 
-  if (variant == NULL)
+  if (variant == NULL || g_variant_get_data (variant) == NULL)
     (void) g_file_delete (path, NULL, NULL);
   else
     {